
/**
 * 启动banner
 */
function startBanner() {
    $(".banner-box").slide({
        titCell:".hd ul",
        mainCell:".bd ul",
        effect:"fold",
        interTime:2000,
        delayTime:500,
        autoPlay:true,
        autoPage:true,
        trigger:"click"
    });
}

/**
 * 设置这个列表
 * @param num
 */
function setMenuListItem(num) {

    let image = "https://images.pexels.com/photos/3283568/pexels-photo-3283568.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500";
    let colS = "";
    let size = 6;
    if (num == 3) {
        colS = 'col-xs-4';
        size = 6;
    }else if (num == 4){
        colS = 'col-xs-3';
        size = 8;
    }else {
        alert("未设置");
        return;
    }

    $("#menuList").empty();
    let divStr = "";//存储容器
    for (let i = 0; i < size; i++) {
        divStr = '<div id="itemId'+ i +'" class="' + colS +'">' +
            '    <div style="text-align:center;">' +
            '        <img class="menu-item-image" src="'+ image +'">' +
            '        <p style="margin-top: 10px">设置文字</p>' +
            '    </div>' +
            ' </div>';

        $("#menuList").append(divStr);
    }
}

/**
 * 设置商品的
 * @param num
 */
function setShopListItem(num) {

    let shopImage = "https://images.pexels.com/photos/3283568/pexels-photo-3283568.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500";
    let size = 6;

    if (num > 0){
        size = num;
    }

    $("#shopList").empty();
    let divStr = "";//存储容器
    for (let i = 0; i < size; i++) {
        divStr = '<div id="shopItem' + i + '" class="col-xs-6">' +
            '        <div >' +
            '           <img class="shop-item-image" src="'+ shopImage +'">' +
            '             <p style="margin-top: 10px">商品名称</p>' +
            '             <p style="margin-top: 5px;color: #B01415">商品价格</p>' +
            '       </div>' +
            '   </div>';

        $("#shopList").append(divStr);
    }
}